<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>基础组件 icon</title>
  <style type="text/css">
    .icon {
      width: 1em;
      height: 1em;
      vertical-align: -0.15em;
      fill: currentColor;
      overflow: hidden;
    }
  </style>
</head>

<body>
  <div class="source">
    <script src="//at.alicdn.com/t/font_1856546_7mvziulu9pw.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
  </div>
  <div id="app">
    <g-icon :name="name"></g-icon>
  </div>

  <script>
    Vue.component('g-icon',{
      template:`
        <svg class="icon" aria-hidden="true">
          <use :xlink:href="`#i-${name}`"></use>
        </svg>
      `,
      props:[name]
    })
    const vm = new Vue({
      el:"#app",
      data:{
        name:'settings'
      }
    })
  </script>
</body>

</html>